<?php

use yii\helpers\Html;
use yii\widgets\DetailView;


$this->title = '客户详情';
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Customers'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="customer-view">

   <div class="box">
        <div class="box-header">
            <?= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
        </div>
        <div class="box-body">  
             <?= DetailView::widget([
                'model' => $model,
                'attributes' => [
                    'name',
                    [
                      'attribute' => 'user_id',
                      'value' => function($model){

                            return isset($model->user) ? $model->user->name : '管理员';
                      }
                    ],
                ],
            ]) ?>
        </div>
    </div>   
    
</div>

